home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_097 / splines / popmenu.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  51 lines

  1. /* The routines in this file are copyright (c) 1987 by Helene (Lee) Taran.
  2.  * Permission is granted for use and free distribution as long as the
  3.  * original author's name is included with the code.
  4.  */
  5.  
  6. #ifndef POPUP_MENU_H
  7. #define POPUP_MENU_H
  8.  
  9. #include <stdio.h>
  10. #include <graphics/display.h>
  11. #include <graphics/gfxmacros.h>
  12. #include <intuition/intuition.h>
  13.  
  14. /* The following constants are the font characteristics of topaz eight :
  15.  * If you want a different font, you'll have to open it in the Init_MenuPackage
  16.  * and set these constants to the appropriate values.
  17.  */
  18. #define FONT_HEIGHT   8   /* pixel height of an average character */
  19. #define FONT_WIDTH    8   /* pixel width of an average character */
  20. #define FONT_BASELINE 6   /* relative pixel location of character baseline */
  21.  
  22. #define MAX(a,b) ((a > b) ? a : b)
  23.  
  24. #define NOITEM_SELECTED 0  /* returned from PopUp if no item was selected */
  25. #define OUTSIDE_WINDOW -1  /* returned from PopUp if cursor outside of window */
  26.  
  27. struct PopUp_Item {
  28.    char *text;                 /* text string to be displayed */
  29.    SHORT selection_id;             /* id returned when this item is selected */
  30.    SHORT left, top;              /* top/left offset within menu */
  31.    SHORT height,width;           /* desired height/width of selection box */
  32.    UBYTE color;                  /* desired text color (= color register) */
  33.    struct PopUp_Item *next;      /* link to next menu item */
  34. };
  35.  
  36. struct PopUp_Menu {
  37.    SHORT depth;                     /* number of bit-planes to use */
  38.    SHORT left,top, height;          /* used internally */
  39.    SHORT width;                  /* desired width of menu */
  40.    USHORT deactivate;               /* what MOUSEBUTTON deactives the menu */
  41.    UBYTE outline_color, area_color; /* color registers */
  42.    struct ClipRect cr;              /* clipping rectangle for display */
  43.    struct RastPort rp;              /* raster port for drawing into menu area */
  44.    struct BitMap bitmap;            /* actual bitmap for rendering the menu */
  45.    struct PopUp_Item *first_item;   /* first in list of menu items */
  46.    struct PopUp_Item *active_item;  /* for internal use only */
  47. };
  48.  
  49. #define Inside_Window(x,y,w)(((x)>0)&&((x)<(w)->Width)&&((y)>0)&&((y)<(w)->Height))
  50. #endif
  51.